#ifndef __MISC__
#define __MISC__

#define getbit(x,y)   ((x) >> (y)&1)

void swap_endian16(uint16_t *a);
void swap_endian32(uint32_t *a);

int16_t fun2s( uint16_t d );

//  used to replace postfix of a given filename
void replace_postfix(   char const*str, 
                        char const *pfix_old, 
                        char const *pfix_new, 
                        char new_str[] );
//  find given postfix in a string
int find_postfix(   char const* str,                                                                                                                                                                                                                       
                    char const* postfix );

#endif	// __MISC__
